<html>
<body style="font-family: Helvetica,Arial, sans-serif; font-size: 8pt;">
<?php
    require_once '../constants.php';
    require_once '../db.php';
    require_once '../feedback.php';

    $row['id'] = $_POST['ii_id'];
    $row['description'] = $_POST['ii_description'];
    $row['submit_date'] = $_POST['ii_submit_date'];
    $row['source'] = $_POST['ii_source'];
    $row['email'] = $_POST['ii_email'];
    $row['status'] = $imgStatuses[$_POST['ii_status']];
    $row['comment'] = $_POST['ii_comment'];

    if ( $_POST['ii_publish_date'] == '0000-00-00' && $row['status'] == IMAGE_STATUS_APPROVED ) {
        $nextDate = date("Y-m-d");
        $row['publish_date'] = $nextDate;
    }
    else {
        $row['publish_date'] = $_POST['ii_publish_date'];
    }

    if ( dbUpdateImageInfo($row) ) {
        notifyUserOfStatusChange($row);
    }
    else {
        $errorMessage = "Database error occured";
    }

?>
</body>
</html>
